.pm_button {
    text-decoration: none;
    color: $button-color;
    padding: 0 10px;
    height: 35px;
    line-height: 35px;
    border: 1px solid $border;
    border-radius: $border-radius;
    display: inline-block;
    cursor: pointer;
    font-size: 12px;
    text-transform: uppercase;
    background-color: transparent;
    transition: all .3s ease-out;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.1);
    -webkit-tap-highlight-color: transparent;
    vertical-align: middle;
    z-index: 1;
    &:hover,
    &:focus {
        background-color: $button-background-focus;
        color: $button-color-focus;
        transition: none;
    }
    &:active {
        background: $button-background-active;
        box-shadow: inset 0 1px 2px 0 rgba(0,0,0,0.05);
    }
    &.fullwidth {
        width: 100%;
    }
    &.large {
        line-height: 50px;
        height: 50px;
        padding: 0 2rem;
        font-size: 16px;
    }
    &.small {
        font-size: 10px;
        height: 30px;
        line-height: 30px;
    }
    &.primary {
        background-color: $primary;
        border-color: $primary;
        color: set-color($primary, $white);

        &:hover,
        &:focus  {
            background-color: darken($primary, 5);
            border-color: transparent;
            color: set-color($primary, $white);
        }
        &:active {
            background-color: #66669a;
            border-color: #66669a;
        }
        &[disabled],
        &.disabled {
            background: lighten($primary, 2%);
        }
        /* modifier for new home buttons */
        &-white {
            background: $white;
            border-color: $white;
            color: $dark;
        }
        &-white:focus,
        &-white:hover {
            background: $primary;
            border-color: $primary;
            color: $white;
        }
        &-white:active {
            background-color: $secondary;
            border-color: $secondary;
            color: $white;
        }
        &-white[disabled] {
            background-color: $white;
        }
    }
    &.link {
        background-color: transparent;
        border-color: transparent;
        color: $primary;
        box-shadow: none;
        &:active,
        &:focus,
        &:hover {
            text-decoration: underline;
        }
        &.color-white {
            color: $white;
        }
    }
    &.autoHeight {
        height:auto;
        line-height: initial;
    }
    &.round {
        display: inline-block;
        height: 30px;
        line-height: 30px;
        width: 30px;
        text-align: center;
        border: 1px solid $border;
        border-radius: 30px;
        padding: 0;
        &.big{
            margin-top:-10px;
            font-size: 22px;
            border-radius: 40px;
            width: 40px;
            height: 40px;
            line-height: 40px;
        }
        .fa {
            color: $primary;
        }
        &:hover,
        &:focus { background-color: #fafafa }
        &:active { background-color: #f4f4f4 }
    }
    &.success {
        background-color: $green;
        border-color: darken($green, 10%);
        color: $white;
        &:hover,
        &:focus {
            background-color: darken($green, 10%);
            border-color: darken($green, 10%);
        }
        &[disabled],
        &.disabled {
            background: lighten($green, 2%);
        }
    }
    &.white {
        background: #FFFFFF;
    }
    &.dark:hover { background: rgba(0,0,0,0.2) }
    &.error {
        background-color: $red;
        border-color: darken($red, 10%);
        color: $white;
        &:hover,
        &:focus {
            background-color: darken($red, 10%);
            border-color: darken($red, 10%);
        }
        &[disabled],
        &.disabled {
            background: lighten($red, 2%);
        }
    }
    &[disabled],
    &.disabled {
        opacity: .5;
        pointer-events: none;
        cursor: default;
        box-shadow: inset 0 0 5rem 0 rgba(0, 0, 0, 0.06);
    }
    &.dead {
        pointer-events: none;
        cursor: default;
    }
    &.main {
        padding: 0px 20px;
    }
    &.dangerous {
        box-shadow: none;
        border:0;
        padding: 0px 4px;
        margin: 0px 10px;
        color:$red;
        span {
            text-decoration: underline;
        }
    }
    strong {
        font-size: 12px;
        text-transform: uppercase;
    }
    // Disable pointer events on icons, svg and span. To disable the situation where you have
    // <button><i class="fa"></i></button> or <button><svg></svg></button>
    // where the onclick handler can receive the icon as target.
    .fa, svg, span {
        pointer-events: none;
    }
}

.pull-right .pm_buttons {
    margin: 0 0 0 10px;
}

.pm_buttons {
    @include flexInline();
    height: 33px;
    margin: 0 10px 0 0;
    position: relative;
    border-radius: 2px;
    color: $button-color;

    &.inline {
        display: inline-block;
        float: none;
    }
    &.disabled {
        color: $button-color-disabled;
    }
    .disabled,
    [disabled] {
        pointer-events: none;
        box-shadow: none;
        box-shadow: inset 0 0 50rem 0 lighten($tertiary, 4%);
        color: $button-color-disabled;
    }
    .dead {
        pointer-events: none;
        cursor: default;
    }
    .fa {
        font-size: 16px;
        &.fa-angle-down {
            font-size: 14px;
            margin-left: 2px;
            &.wide {
                padding: 0 10px;
            }
        }
    }
    .pm_buttons {
        float:left; /* inline-block add extra space*/
        border-radius: 0;
        margin: 0 !important; /* overide unknow margin for appConfigBody-is-mobile */
        border: 0;
    }

    a,
    button {
        @include flexInline();
        @include flexFillHeight();
        @include flexAlignCenter();

        text-decoration: none;
        color: inherit;
        padding: 0 10px;
        cursor: pointer;
        transition: all .3s ease-out;
        -webkit-tap-highlight-color: transparent;
        /* no z-index here, otherwise, menus will fail */
        box-shadow: 0 1px 2px 0 rgba(0,0,0,0.1);
        background: $button-background;
        border: 1px solid $border;

        &:not(:last-of-type){
            border-right: 0;
        }

        &.fa-angle-down {
            padding: 0 3px;
            &.wide {
                padding: 0 10px;
            }
        }
        &:hover,
        &:focus {
            background-color: $button-background-focus;
            color: $button-color-focus;
            transition: none;
        }

        &.inheritPadding {
            padding: inherit;
        }

    }

    a, .pm_button {
        &:active,
        &.active {
            background: $button-background-active;
            box-shadow: inset 0 2px 2px 0 rgba(0,0,0,0.2);
        }
    }

    &.link {
        border: none;
        .pm_button {
            padding: 0;
            background-color: transparent;
            border-color: transparent;
            color: $primary;
            box-shadow: none;
            &:active,
            &:focus,
            &:hover {
                text-decoration: underline;
            }
        }
        .disabled {
            visibility: hidden;
        }
    }
    strong {
        font-size: 12px;
        text-transform: uppercase;
    }
    & > * {
        border-right: 0;
    }
    & > *:first-child {
        border-radius: 2px 0 0 2px;
    }
    & > *:last-child {
        border-radius: 0 2px 2px 0;
    }
    &.primary {
        a {
            background-color: $primary;
            border-color: $primary;
            color: $white;
            &:hover,
            &:focus {
                background-color: #7e82b4;
                border-color: #7e82b4;
            }
            &:active {
                background-color: 66669a;
                border-color: 66669a;
            }
        }
        & > * {
            border-left: 1px solid $white;
        }
        & > *:first-child {
            border-left: none;
        }
    }
}

/* pm_buttons with child button */
.pm_buttons .pm_buttons-child {
    border: 1px solid $border;
    padding: 0;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.1);
    background: $button-background;
    &:not(:last-of-type){
        border-right: 0;
    }
}

.pm_buttons .pm_buttons-child:hover,
.pm_buttons .pm_buttons-child:focus {
    background-color: $button-background-focus;
    color: $button-color-focus;
}

.pm_buttons .pm_buttons-child:active {
    background: $button-background-active;
    box-shadow: inset 0 2px 2px 0 rgba(0,0,0,0.2);
}

.pm_buttons > .pm_buttons-child.fa::before,
.pm_buttons > .pm_buttons-child > div {
    display: inline-flex;
    flex-grow: 1;
    align-items: center;
    padding: 0 10px;
    cursor: pointer;
    transition: all .3s ease-out;
    pointer-events: none;
}

.pm_buttons, .pm_button {
    [type=checkbox][disabled]:before {
        content:"";
        display:inline-block;
        width:12px;
        height:12px;
        background: lighten($border, 10%);
        border-radius: 2px;
    }
}

.pm_buttons,
.pm_button,
.pm_trigger { user-select: none }


body.appConfigBody-is-mobile {
    .pm_buttons { margin: 0 5px 0 0 }

    .pm_buttons:last-of-type { margin: 0; }
}
